package com.rxjava.jdbc;

import java.util.List;

import com.github.davidmoten.rx.jdbc.Database;

public class RxjavaJdbc {
	public static final String url = "jdbc:mysql://localhost:3306/hiwetop?useUnicode=true&characterEncoding=utf8&autoReconnect=true&amp;failOverReadOnly=false";
	public static final String username = "root";
	public static final String password = "login";
	
	static Database db = null;
	static {
		db = Database.from(url, username, password);
	}
	
	public static void main(String[] args) {
		List<String> names = db
		        .select("select account from user_info where account = ? order by account")
		        .parameter("linyu")
		        .getAs(String.class)
		        .toList().toBlocking().single();
		System.out.println(names);
	}
}
